﻿using AiXiu.BLL;
using AiXiu.IBLL;
using AiXiu.Model;
using AiXiu.Model.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AiXiu.Web
{
    /// <summary>
    /// 聊天页
    /// </summary>
    public partial class Chat : System.Web.UI.Page
    {
        protected int selfId;
        protected int otherId;
        protected Friend friend;
        protected TBUsers user;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["to"]==null) { Response.Redirect("Friends.aspx");return; }
                this.user = IdentityManager.ReadUser();
                this.selfId = user.Id;
                this.otherId = int.Parse(Request.QueryString["to"]);
                IUserManager userManager = new UserManager();
                this.friend = userManager.GetFriend(selfId, otherId);
            }
        }
    }
}